<?php defined('SYSPATH') OR die('No direct access allowed.'); ?>
<script type="text/javascript">
$(document).ready(function() {
	
	$("#cboClub").change(function() {
		var uri = ISS.lang.getBasePath()+'index.php/admin/club_member/ajax_page/'+this.value+'/'+1;
		ISS.Ajax.Caller.request(uri, null);
	});
}); 

</script>

<?php 	
	echo html::Stylesheet(
		array
		(
			'media/css/club_block.css',
		),
		array
		(
			'screen',
		)
	);	
?>

<div id="mainCont">
	<h3>รายการสมาชิกในคลับเพลง</h3>
	<select style="width:150px"
		id="cboClub"
		name="cboClub">
		<option value="0"></option>
		<?php foreach ($clubs as $club): ?>
		<option value="<?php echo $club['id']; ?>"><?php echo html::specialchars($club['name']); ?></option>
	    <?php endforeach ?>	
	    
	</select>
	<div id="clubMember">
		<table>
		    <tr>
		        <th>สมาชิก</th>
		        <th>ประเภท</th>
		        <th>คำสั่ง</th>
		    </tr>
		    <?php 
		    	$i = 0;
		    	foreach ($members as $member): 
		    		$i++;
		    		echo (($i % 2)==0) ? '<tr class="clubListDark">' : '<tr class="clubListLight">';
		    ?>
		        <td><?php echo html::specialchars($member->prefix . ' ' . $member->firstname . ' ' . $member->lastname); ?></td>
		        <td><?php echo html::specialchars($member->member_type); ?></td>
				<td>
		        	<a class="actionDel" href="<?php echo url::base(); ?>/index.php/admin/club_member/del/<?php echo $member->club_id; ?>/<?php echo $member->id; ?>" ><img alt="ลบ" src="<?php echo url::base();?>/media/images/delete.png"/></a>
		        </td>
		    </tr>
		    <?php endforeach ?>
		</table>
	
		<?php echo $pagination ?>
	</div>
</div>